Repository navigation
Conversation
Configuration keys are stored in lower case, so a group declared as W1 was only found with "-n w1", while "-n Dom" finds profile Dom. Fall back to the lower case name when looking up a group. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #705 +/- ##
==========================================
+ Coverage 85.42% 85.43% +0.01%
==========================================
Files 161 161
Lines 10399 10403 +4
==========================================
+ Hits 8883 8887 +4
Misses 1516 1516
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
creativeprojects
left a comment
There was a problem hiding this comment.
Thanks for this PR 👍🏻
creativeprojects
left a comment
There was a problem hiding this comment.
Actually, I just re-read the bug report 🤔
The issue wasn't that he couldn't load the group as w1, but is that when the profiles were written lowercase it couldn't load them. I understand this issue to be with this config:
version: 2
groups:
W1:
profiles: [ dom, ha ]
profiles:
Dom:
inherit: default
Ha:
inherit: default|
No actionable comments were generated in the recent review. WalkthroughProfile group lookup now checks the supplied name and, if needed, its lowercase form. Tests verify both forms against TOML and version 2 YAML configurations. ChangesProfile group lookup
Estimated code review effort: 2 (Simple) | ~7 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk:
|
Fixes #646
Viper stores every configuration key in lower case. Profiles are looked up through viper (
IsSet/Sub), which ignores case, so-n DomfindsDom. Groups are loaded once intocached.groups, keyed by the lower-case names viper returns, andHasProfileGroup/GetProfileGroupindex that map with the name exactly as typed. A group declared asW1is therefore only reachable as-n w1, which is the inconsistency the issue describes.With the config from the issue (v2, group
W1: profiles: [Dom, Ha]) and a stubrestic:Change: a small
lookupGrouphelper tries the name as given, then in lower case. BothHasProfileGroupandGetProfileGroupuse it, so the run,showand the schedule commands behave the same. The profile names inside the group are not touched: they already resolve in any case, as the issue notes.Test:
TestGetProfileGroupMixedCase(v1 TOML and v2 YAML) checksW1andw1both find the group andW2does not. It fails on master forW1.I used an AI assistant (Claude) to help with this change; I reviewed it and ran the checks above myself.